<template>
    <div class="seckillbox">
        <div class="seckilltop">
            <span class="sha">嗨购秒杀</span>
            <span class="chang">14点场</span>
            <span class="sj">
                <van-count-down :time="time">
                    <template #default="timeData">
                        <span class="block">{{ timeData.hours }}</span>
                        <span class="colon">:</span>
                        <span class="block">{{ timeData.minutes }}</span>
                        <span class="colon">:</span>
                        <span class="block">{{ timeData.seconds }}</span>
                    </template>
                </van-count-down>
            </span>
            <span class="fc">爆款轮播秒
                <van-icon name="arrow" />
            </span>
        </div>
        <ul class="seckill-list">
            <li v-for="item in imgs" :key="item.proid">
                <img :src="item.img1" alt="">
                <p>￥{{ item.originprice }}</p>
            </li>
        </ul>
    </div>
</template>

<script>

export default {
    data() {
        return {
            time: 2 * 60 * 60 * 1000,
            imgs: []
        };
    },
    created() {
        this.$http.get("/pro/seckilllist", {
            params: {
                count: 1,
                limitNum: 6
            }
        })
            .then(res => {
                if (res.data.code === "200") {
                    this.imgs = res.data.data;
                }
            })
    }

}

</script>
<style scoped>
.seckillbox {
    width: 100%;
    height: 140px;
    background-color: #fff;
    border-radius: 15px;
    padding: 5px;
    box-sizing: border-box;
    margin-top: 5px;
}

.seckilltop {
    font-size: 12px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 100%;

}

.seckill-list {
    width: 100%;
    height: 5.625rem;
    display: flex;
    justify-content: space-evenly;
    align-items: center;
}

.seckill-list li {
    height: 60px;
}

.seckill-list li p {
    text-align: center;
    font-size: 12px;
    color: #ff6666;
}

.seckill-list img {
    width: 54px;
    height: 54px;
}

.sha {
    color: #000;
}

.chang {
    color: #ff6666;
}

.colon {
    display: inline-block;
    margin: 0 4px;
    color: #ee0a24;
}

.block {
    display: inline-block;
    width: 22px;
    height: 25px;
    line-height: 25px;
    color: #fff;
    font-size: 12px;
    text-align: center;
    background-color: #ee0a24;
    border-radius: 5px;
}

.sj {
    width: 140px;
}

.fc {
    font-size: 12px;
    color: #ff6666;
}
</style>